CREATE TABLE [SSB].[IncomeType]
(
[SSBincomeIntrnlID] [int] NOT NULL IDENTITY(1, 1),
[FSIncomeTypeId] [int] NOT NULL,
[AccountName] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[LocalCurrencyCodeId] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [SSB].[IncomeType] ADD CONSTRAINT [pk_AcctCurrId] PRIMARY KEY CLUSTERED  ([SSBincomeIntrnlID], [AccountName], [LocalCurrencyCodeId]) ON [PRIMARY]
GO
ALTER TABLE [SSB].[IncomeType] ADD CONSTRAINT [FK_IncomeType_FSIncomeType] FOREIGN KEY ([FSIncomeTypeId]) REFERENCES [SSB].[FSIncomeType] ([FSIncomeTypeId])
GO
ALTER TABLE [SSB].[IncomeType] ADD CONSTRAINT [FK__IncomeTyp__Local__3CBF0154] FOREIGN KEY ([LocalCurrencyCodeId]) REFERENCES [SSB].[LocalCurrencyCode] ([LocalCurrencyCodeId])
GO
EXEC sp_addextendedproperty N'VirtualFolder', N'SSB Stuff', 'SCHEMA', N'SSB', 'TABLE', N'IncomeType', NULL, NULL
GO
